/*
* @Author: Administrator
* @Date:   2018-09-15 09:59:37
* @Last Modified by:   Administrator
* @Last Modified time: 2018-09-15 10:09:55
*/
import React from 'react';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom'
class Write extends React.Component {
  render () {
    const { login } = this.props;
    if (login) {
      return (
      <div>写文章</div>
     )
    }
  	else {
      //Redirect是重定向
       return <Redirect exact from='/' to="/login"/>
    } 
  }
}

const mapState = (state) => ({
  login: state.getIn(['login', 'login'])
})


export default connect(mapState,null)(Write);